/* 第一种 */
/* .parent{
    height: 200px;
    display: flex;
    align-items:center;
    justify-content: center;
    background-color: pink;
}
.child{
    width: 100px;
    height: 100px;
    background-color: skyblue;
} */
/* 第二种 */
/* .parent{
    padding:20px;
    background-color: aqua;
}
.child{
    height: 200px;
    background-color: red;
}  */
/* 第三种 */
/* .parent{
  position: relative;
  height: 200px;
  background-color: red;
}
.child{
    width: 100px;
    height: 100px;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    background-color: blue;
}   */
/* 第四种 */
/* .parent{
    position: relative;
    height: 200px;
    background-color: red;
}
.child{
    position: absolute;
    background: blue;
    width: 100px;
    height: 100px;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
}  */
/* 第五种 */
/* .parent{
    position: relative;
    height: 200px;
    background-color: red;
}
.child{
    position: absolute;
    background: rgb(95, 97, 90);
    width: 100px;
    height: 100px;
    left: calc(50% - 50px);
    top: calc(50% - 50px); 
 }  */
/* 第六种 */
/* .parent{
    position: relative;
    height: 200px;
    background-color: red;
}
.child{
    position: absolute;
    background: blue;
    width: 100px;
    height: 100px;
    left: 50%;
    top: 50%;
    margin-top: -50px;
    margin-left: -50px;
}  */
/* 第七种 */
.parent{
    height: 200px;
    text-align: center;
    background-color: blueviolet;
}
.child{
    width: 100px;
    height: 100px;
    display: inline-block;
    vertical-align: middle;
    background-color: brown;
} 
.parent::before{
    content: "";
    width: 20px;vertical-align: middle;
    height: 200px;
    display: inline-block;
}
